The packages are automatically loaded using pacman. The reported .html was last ran on the system: x86_64-apple-darwin17.0 and R version: R version 4.2.1 (2022-06-23) In the Stage 1 PCI Registered Report we are focused on Individual Continues (intraclass correlation) and the binary/continuoues group similarity (jaccard and spearman). Related to the descriptive file here, we describe each step that contained within this file that is relevant to the registered analyses

continuous

We stated:

Aim1: the range and distribution of median ICCs across each study (three) and analytic decision category (four) are plotted across suprathreshold task-positive and subthreshold ICCs using Rainclouds (Allen et al., 2019) and the median and standard deviation is reported in a table.

to visualize the ordered median ICCs across the 360 model permutations for suprathreshold task-positive and subthreshold ICCs, specification curve analyses are used (Simonsohn et al., 2020). Specifically, results across the 360 model permutations are reported using a specification curve to represent the range of estimated effects across the variable permutations. This consists of two panels: Panel A represents the ordered ICC coefficients and the ICC’s associated 95% confidence interval colored based on no significance (gray), negative (red) or positive (blue) significance from the Null (Null here is 0) and Panel B represents the analytic decisions from each of the four categories (see Table 1) that produced the median ICC estimates. In the main text, to compare the highest and lowest ICC’s produced by the model permutations, the 25th percentile and 75th percentile median ICC estimates from the 360 models are reported separately for suprathreshold task-positive and subthreshold activation (the specification curve for all ICC estimates for suprathreshold task-positive and subthreshold activation are provided as supplemental information).

Aim2: the range and distribution of median MSBS and MSWS across each study and analytic decision category are plotted across suprathreshold task-positive and subthreshold ICCs using Rainclouds.

two separate specification curve analyses report the ordered median MSBS and MSWS coefficients in one panel and the analytic decisions that produced the MSBS and MSWS estimates in a second panel separately for suprathreshold task-positive and subthreshold activation

group similarity

We stated:

Aim1: For each study, the coefficients are plotted to reflect the distribution and range of coefficients. Both Jaccard’s and Spearman correlation are reported separately.



1 Load data

1.1 ABCD

# ICC
abcd_icc_subthresh <- read.csv("output/sample-abcd_type-run_stats-est_mask-wilson-sub.tsv", sep = '\t')
abcd_icc_subthresh$study <- "abcd"
abcd_icc_suprathresh <- read.csv("output/sample-abcd_type-run_stats-est_mask-wilson-supra.tsv", sep = '\t')
abcd_icc_suprathresh$study <- "abcd"
# MSBS
abcd_bs_subthresh <- read.csv("output/sample-abcd_type-run_stats-bs_mask-wilson-sub.tsv", sep = '\t')
abcd_bs_subthresh$study <- "abcd"
abcd_bs_suprathresh <- read.csv("output/sample-abcd_type-run_stats-bs_mask-wilson-supra.tsv", sep = '\t')
abcd_bs_suprathresh$study <- "abcd"
# MSWS
abcd_ws_subthresh <- read.csv("output/sample-abcd_type-run_stats-ws_mask-wilson-sub.tsv", sep = '\t')
abcd_ws_subthresh$study <- "abcd"
abcd_ws_suprathresh <- read.csv("output/sample-abcd_type-run_stats-ws_mask-wilson-supra.tsv", sep = '\t')
abcd_ws_suprathresh$study <- "abcd"

# similarity
abcd_similarity <- read.csv("output/sample-abcd_type-run_stats-similarity.tsv", sep = '\t')
abcd_similarity$study <- "abcd"

1.2 AHRB (test, dup abcd)

[UPDATE PATH sample-abcd when data is available]

# ICC
ahrb_icc_subthresh <- read.csv("output/sample-abcd_type-run_stats-est_mask-wilson-sub.tsv", sep = '\t')
ahrb_icc_subthresh$study <- "ahrb"
ahrb_icc_suprathresh <- read.csv("output/sample-abcd_type-run_stats-est_mask-wilson-supra.tsv", sep = '\t')
ahrb_icc_suprathresh$study <- "ahrb"
# MSBS
ahrb_bs_subthresh <- read.csv("output/sample-abcd_type-run_stats-bs_mask-wilson-sub.tsv", sep = '\t')
ahrb_bs_subthresh$study <- "ahrb"
ahrb_bs_suprathresh <- read.csv("output/sample-abcd_type-run_stats-bs_mask-wilson-supra.tsv", sep = '\t')
ahrb_bs_suprathresh$study <- "ahrb"
# MSWS
ahrb_ws_subthresh <- read.csv("output/sample-abcd_type-run_stats-ws_mask-wilson-sub.tsv", sep = '\t')
ahrb_ws_subthresh$study <- "ahrb"
ahrb_ws_suprathresh <- read.csv("output/sample-abcd_type-run_stats-ws_mask-wilson-supra.tsv", sep = '\t')
ahrb_ws_suprathresh$study <- "ahrb"
# similarity
ahrb_similarity <- read.csv("output/sample-abcd_type-run_stats-similarity.tsv", sep = '\t')
ahrb_similarity$study <- "ahrb"

1.3 MLS (no data, do not run)

1.4 combine data

# ICC
icc_subthresh <- rbind(abcd_icc_subthresh, ahrb_icc_subthresh)#, mls_icc_subthresh)
icc_subthresh <- icc_subthresh %>% mutate(
    con = gsub("contrast-", "", con),
    motion = gsub("mot-", "", motion),
    model = gsub("mod-", "", model),
    fwhm = gsub("fwhm-", "", fwhm)
  ) %>% 
  mutate(con = gsub("-", "", con))
icc_suprathresh <- rbind(abcd_icc_suprathresh, ahrb_icc_suprathresh)#, mls_icc_suprathresh)
icc_suprathresh <-  icc_suprathresh %>% mutate(
    con = gsub("contrast-", "", con),
    motion = gsub("mot-", "", motion),
    model = gsub("mod-", "", model),
    fwhm = gsub("fwhm-", "", fwhm)
  ) %>% 
  mutate(con = gsub("-", "", con))

# MSBS
bs_subthresh <- rbind(abcd_bs_subthresh, ahrb_bs_subthresh)#, mls_bs_subthresh)
bs_subthresh <- bs_subthresh %>% mutate(
    con = gsub("contrast-", "", con),
    motion = gsub("mot-", "", motion),
    model = gsub("mod-", "", model),
    fwhm = gsub("fwhm-", "", fwhm)
  ) %>% 
  mutate(con = gsub("-", "", con))
bs_suprathresh <- rbind(abcd_bs_suprathresh, ahrb_bs_suprathresh)#, mls_bs_suprathresh)
bs_suprathresh <-  bs_suprathresh %>% mutate(
    con = gsub("contrast-", "", con),
    motion = gsub("mot-", "", motion),
    model = gsub("mod-", "", model),
    fwhm = gsub("fwhm-", "", fwhm)
  ) %>% 
  mutate(con = gsub("-", "", con))

# MSWS
ws_subthresh <- rbind(abcd_ws_subthresh, ahrb_ws_subthresh)#, mls_bs_subthresh)
ws_subthresh <- ws_subthresh %>% mutate(
    con = gsub("contrast-", "", con),
    motion = gsub("mot-", "", motion),
    model = gsub("mod-", "", model),
    fwhm = gsub("fwhm-", "", fwhm)
  ) %>% 
  mutate(con = gsub("-", "", con))
ws_suprathresh <- rbind(abcd_ws_suprathresh, ahrb_ws_suprathresh)#, mls_bs_suprathresh)
ws_suprathresh <-  ws_suprathresh %>% mutate(
    con = gsub("contrast-", "", con),
    motion = gsub("mot-", "", motion),
    model = gsub("mod-", "", model),
    fwhm = gsub("fwhm-", "", fwhm)
  ) %>% 
  mutate(con = gsub("-", "", con))

# similarity
similarity_df <- rbind(abcd_similarity, ahrb_similarity)#, mls_similarity)
similarity_df <-  similarity_df %>% 
  mutate(con = gsub("-", "", con))
similarity_df$fwhm <- as.character(similarity_df$fwhm)

# remove excess files
rm(ahrb_bs_subthresh, ahrb_bs_suprathresh, ahrb_icc_subthresh, ahrb_icc_suprathresh, ahrb_ws_subthresh, ahrb_ws_suprathresh,ahrb_similarity,
   abcd_bs_subthresh, abcd_bs_suprathresh, abcd_icc_subthresh, abcd_icc_suprathresh, abcd_ws_subthresh, abcd_ws_suprathresh,abcd_similarity)
   #mls_bs_subthresh, mls_bs_suprathresh, mls_icc_subthresh, mls_icc_suprathresh, mls_ws_subthresh, mls_ws_suprathresh,mls_similarity)

2 Plot distributions

Below, running the steps to summarize the different Intraclass correlation (ICC), Mean Squared Between Subject (MSBS), Mean Square Within Subject (MSWS), and jaccard and spearman similarty for the model combinations 360 across samples

2.1 ICC

Plotting overall and for each of [four] categories

2.1.1 Subthreshold Mask

icc_dist = icc_subthresh %>% 
  ggplot(aes(x = median_est)) + 
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  ggtitle("Overall Distribution (Subtreshold mask)") +
  facet_grid(~study)+
  theme_minimal()


fwhm_dist = icc_subthresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~fwhm) +
  ggtitle("Distribution by FWHM category (Subtreshold mask)") +
  facet_grid(~study) +
  theme_minimal()


motion_dist = icc_subthresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~motion) +
  ggtitle("Distribution by Motion category (Subtreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

contrast_dist = icc_subthresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~con) +
  ggtitle("Distribution by Contrast category (Subtreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

modeltype_dist = icc_subthresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~model) +
  ggtitle("Distribution by Model Type category (Subtreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

icc_dist 

fwhm_dist

motion_dist

contrast_dist

modeltype_dist

Creating rainclouds via ggrain

fwhm_rg = icc_subthresh %>% ggplot(aes(x = fwhm, y = median_est, fill = fwhm, color = fwhm)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by FWHN category (Subtreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))


motion_rg = icc_subthresh %>% ggplot(aes(x = motion, y = median_est, fill = motion, color = motion)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Motion category  (Subtreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

modeltype_rg = icc_subthresh %>% ggplot(aes(x = model, y = median_est, fill = model, color = model)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Model Type category  (Subtreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

contrast_rg = icc_subthresh %>% ggplot(aes(x = con, y = median_est, fill = con, color = con)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Contrast category  (Subtreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

fwhm_rg

motion_rg

modeltype_rg

contrast_rg

2.1.2 Suprathreshold Mask

icc_dist = icc_suprathresh %>% 
  ggplot(aes(x = median_est)) + 
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  ggtitle("Overall Distribution (Supratreshold mask)") +
  facet_grid(~study)+
  theme_minimal()


fwhm_dist = icc_suprathresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~fwhm) +
  ggtitle("Distribution by FWHM category (Supratreshold mask)") +
  facet_grid(~study) +
  theme_minimal()


motion_dist = icc_suprathresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~motion) +
  ggtitle("Distribution by Motion category (Supratreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

contrast_dist = icc_suprathresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~con) +
  ggtitle("Distribution by Contrast category (Supratreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

modeltype_dist = icc_suprathresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~model) +
  ggtitle("Distribution by Model Type category (Supratreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

icc_dist 

fwhm_dist

motion_dist

contrast_dist

modeltype_dist

fwhm_rg = icc_suprathresh %>% ggplot(aes(x = fwhm, y = median_est, fill = fwhm, color = fwhm)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by FWHN category (Supratreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))


motion_rg = icc_suprathresh %>% ggplot(aes(x = motion, y = median_est, fill = motion, color = motion)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Motion category  (Supratreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

modeltype_rg = icc_suprathresh %>% ggplot(aes(x = model, y = median_est, fill = model, color = model)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Model Type category  (Supratreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

contrast_rg = icc_suprathresh %>% ggplot(aes(x = con, y = median_est, fill = con, color = con)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Contrast category  (Supratreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

fwhm_rg

motion_rg

modeltype_rg

contrast_rg

2.2 MSBS

Plotting overall and for each of [four] categories

2.2.1 Subthreshold Mask

bs_dist = bs_subthresh %>% 
  ggplot(aes(x = median_est)) + 
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  ggtitle("Overall Distribution (Subtreshold mask)") +
  facet_grid(~study)+
  theme_minimal()


fwhm_dist = bs_subthresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~fwhm) +
  ggtitle("Distribution by FWHM category (Subtreshold mask)") +
  facet_grid(~study) +
  theme_minimal()


motion_dist = bs_subthresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~motion) +
  ggtitle("Distribution by Motion category (Subtreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

contrast_dist = bs_subthresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~con) +
  ggtitle("Distribution by Contrast category (Subtreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

modeltype_dist = bs_subthresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~model) +
  ggtitle("Distribution by Model Type category (Subtreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

bs_dist 

fwhm_dist

motion_dist

contrast_dist

modeltype_dist

fwhm_rg = bs_subthresh %>% ggplot(aes(x = fwhm, y = median_est, fill = fwhm, color = fwhm)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by FWHN category (Subtreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))


motion_rg = bs_subthresh %>% ggplot(aes(x = motion, y = median_est, fill = motion, color = motion)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Motion category  (Subtreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

modeltype_rg = bs_subthresh %>% ggplot(aes(x = model, y = median_est, fill = model, color = model)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Model Type category  (Subtreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

contrast_rg = bs_subthresh %>% ggplot(aes(x = con, y = median_est, fill = con, color = con)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Contrast category  (Subtreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

fwhm_rg

motion_rg

modeltype_rg

contrast_rg

2.2.2 Suprathreshold Mask

bs_dist = bs_suprathresh %>% 
  ggplot(aes(x = median_est)) + 
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  ggtitle("Overall Distribution (Supratreshold mask)") +
  facet_grid(~study)+
  theme_minimal()


fwhm_dist = bs_suprathresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~fwhm) +
  ggtitle("Distribution by FWHM category (Supratreshold mask)") +
  facet_grid(~study) +
  theme_minimal()


motion_dist = bs_suprathresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~motion) +
  ggtitle("Distribution by Motion category (Supratreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

contrast_dist = bs_suprathresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~con) +
  ggtitle("Distribution by Contrast category (Supratreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

modeltype_dist = bs_suprathresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~model) +
  ggtitle("Distribution by Model Type category (Supratreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

bs_dist 

fwhm_dist

motion_dist

contrast_dist

modeltype_dist

2.3 MSWS

Plotting overall and for each of [four] categories

2.3.1 Subthreshold Mask

ws_dist = ws_subthresh %>% 
  ggplot(aes(x = median_est)) + 
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  ggtitle("Overall Distribution (Subtreshold mask)") +
  facet_grid(~study)+
  theme_minimal()


fwhm_dist = ws_subthresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~fwhm) +
  ggtitle("Distribution by FWHM category (Subtreshold mask)") +
  facet_grid(~study) +
  theme_minimal()


motion_dist = ws_subthresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~motion) +
  ggtitle("Distribution by Motion category (Subtreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

contrast_dist = ws_subthresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~con) +
  ggtitle("Distribution by Contrast category (Subtreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

modeltype_dist = ws_subthresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~model) +
  ggtitle("Distribution by Model Type category (Subtreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

ws_dist 

fwhm_dist

motion_dist

contrast_dist

modeltype_dist

fwhm_rg = ws_subthresh %>% ggplot(aes(x = fwhm, y = median_est, fill = fwhm, color = fwhm)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by FWHN category (Subtreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))


motion_rg = ws_subthresh %>% ggplot(aes(x = motion, y = median_est, fill = motion, color = motion)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Motion category  (Subtreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

modeltype_rg = ws_subthresh %>% ggplot(aes(x = model, y = median_est, fill = model, color = model)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Model Type category  (Subtreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

contrast_rg = ws_subthresh %>% ggplot(aes(x = con, y = median_est, fill = con, color = con)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Contrast category  (Subtreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

fwhm_rg

motion_rg

modeltype_rg

contrast_rg

2.3.2 Suprathreshold Mask

ws_dist = ws_suprathresh %>% 
  ggplot(aes(x = median_est)) + 
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  ggtitle("Overall Distribution (Supratreshold mask)") +
  facet_grid(~study)+
  theme_minimal()


fwhm_dist = ws_suprathresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~fwhm) +
  ggtitle("Distribution by FWHM category (Supratreshold mask)") +
  facet_grid(~study) +
  theme_minimal()


motion_dist = ws_suprathresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~motion) +
  ggtitle("Distribution by Motion category (Supratreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

contrast_dist = ws_suprathresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~con) +
  ggtitle("Distribution by Contrast category (Supratreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

modeltype_dist = ws_suprathresh %>% 
  ggplot(aes(x = median_est)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~model) +
  ggtitle("Distribution by Model Type category (Supratreshold mask)") +
  facet_grid(~study) +
  theme_minimal()

ws_dist 

fwhm_dist

motion_dist

contrast_dist

modeltype_dist

fwhm_rg = ws_suprathresh %>% ggplot(aes(x = fwhm, y = median_est, fill = fwhm, color = fwhm)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by FWHN category (Supratreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))


motion_rg = ws_suprathresh %>% ggplot(aes(x = motion, y = median_est, fill = motion, color = motion)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Motion category  (Supratreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

modeltype_rg = ws_suprathresh %>% ggplot(aes(x = model, y = median_est, fill = model, color = model)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Model Type category  (Supratreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

contrast_rg = ws_suprathresh %>% ggplot(aes(x = con, y = median_est, fill = con, color = con)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Contrast category  (Supratreshold mask)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

fwhm_rg

motion_rg

modeltype_rg

contrast_rg

2.4 Similarity

2.4.1 jaccard

jaccard_dist = similarity_df %>% 
  ggplot(aes(x = jaccard)) + 
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  ggtitle("Overall Distribution  (Jaccard)") +
  facet_grid(~study)+
  theme_minimal()


fwhm_dist = similarity_df %>% 
  ggplot(aes(x = jaccard)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~fwhm) +
  ggtitle("Distribution by FWHM category  (Jaccard)") +
  facet_grid(~study) +
  theme_minimal()


motion_dist = similarity_df %>% 
  ggplot(aes(x = jaccard)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~motion) +
  ggtitle("Distribution by Motion category  (Jaccard)") +
  facet_grid(~study) +
  theme_minimal()

contrast_dist = similarity_df %>% 
  ggplot(aes(x = jaccard)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~con) +
  ggtitle("Distribution by Contrast category  (Jaccard)") +
  facet_grid(~study) +
  theme_minimal()

modeltype_dist = similarity_df %>% 
  ggplot(aes(x = jaccard)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~model) +
  ggtitle("Distribution by Model Type category  (Jaccard)") +
  facet_grid(~study) +
  theme_minimal()

jaccard_dist 

fwhm_dist

motion_dist

contrast_dist

modeltype_dist

fwhm_rg = similarity_df %>% ggplot(aes(x = fwhm, y = jaccard, fill = fwhm, color = fwhm)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by FWHN category  (Jaccard)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))


motion_rg = similarity_df %>% ggplot(aes(x = motion, y = jaccard, fill = motion, color = motion)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Motion category (Jaccard)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

modeltype_rg = similarity_df %>% ggplot(aes(x = model, y = jaccard, fill = model, color = model)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Model Type category  (Jaccard)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

contrast_rg = similarity_df %>% ggplot(aes(x = con, y = jaccard, fill = con, color = con)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Contrast category  (Jaccard)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

fwhm_rg

motion_rg

modeltype_rg

contrast_rg

2.4.2 spearman

spearman_dist = similarity_df %>% 
  ggplot(aes(x = spearman)) + 
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  ggtitle("Overall Distribution  (spearman)") +
  facet_grid(~study)+
  theme_minimal()


fwhm_dist = similarity_df %>% 
  ggplot(aes(x = spearman)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~fwhm) +
  ggtitle("Distribution by FWHM category  (spearman)") +
  facet_grid(~study) +
  theme_minimal()


motion_dist = similarity_df %>% 
  ggplot(aes(x = spearman)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~motion) +
  ggtitle("Distribution by Motion category  (spearman)") +
  facet_grid(~study) +
  theme_minimal()

contrast_dist = similarity_df %>% 
  ggplot(aes(x = spearman)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~con) +
  ggtitle("Distribution by Contrast category  (spearman)") +
  facet_grid(~study) +
  theme_minimal()

modeltype_dist = similarity_df %>% 
  ggplot(aes(x = spearman)) +
  geom_histogram(bins = 50, fill = "white", colour = "black") +
  facet_wrap(~model) +
  ggtitle("Distribution by Model Type category  (spearman)") +
  facet_grid(~study) +
  theme_minimal()

spearman_dist 

fwhm_dist

motion_dist

contrast_dist

modeltype_dist

fwhm_rg = similarity_df %>% ggplot(aes(x = fwhm, y = spearman, fill = fwhm, color = fwhm)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by FWHN category  (spearman)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))


motion_rg = similarity_df %>% ggplot(aes(x = motion, y = spearman, fill = motion, color = motion)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Motion category (spearman)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

modeltype_rg = similarity_df %>% ggplot(aes(x = model, y = spearman, fill = model, color = model)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Model Type category  (spearman)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

contrast_rg = similarity_df %>% ggplot(aes(x = con, y = spearman, fill = con, color = con)) +
  geom_rain(alpha = .5, rain.side = 'l',
            boxplot.args = list(color = "black", outlier.shape = NA),
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .1), width = 0.1
            )) +
  theme_classic() +
  ggtitle("Distribution by Contrast category  (spearman)") +
  scale_fill_brewer(palette = 'Dark2') +
  scale_color_brewer(palette = 'Dark2') +
  guides(fill = 'none', color = 'none') +
  theme(text = element_text(family = "Times New Roman"),
        axis.text = element_text(size = 10),
        axis.title = element_text(size = 10),
        legend.text = element_text(size = 10),
        legend.title = element_text(size = 10),
        plot.title = element_text(size = 16))

fwhm_rg

motion_rg

modeltype_rg

contrast_rg

3 Med/Min/Max Across Models

3.1 Subtreshold

cat("Subthreshold mask")
## Subthreshold mask
cat("\tICC, MSBS and MSWS median, miniumum and maximum")
##  ICC, MSBS and MSWS median, miniumum and maximum
icc_subthresh %>%
  select(study, median_est) %>% 
  group_by(study) %>% 
  summarise("icc median" = median(median_est), "icc min" = min(median_est), "icc max" = max(median_est))
## # A tibble: 2 × 4
##   study `icc median` `icc min` `icc max`
##   <chr>        <dbl>     <dbl>     <dbl>
## 1 abcd         0.054    -0.126     0.373
## 2 ahrb         0.054    -0.126     0.373
bs_subthresh %>%
  select(study, median_est) %>% 
  group_by(study) %>% 
  summarise("msbs median" = median(median_est), "msbs min" = min(median_est), "msbs min" = max(median_est))
## # A tibble: 2 × 3
##   study `msbs median` `msbs min`
##   <chr>         <dbl>      <dbl>
## 1 abcd           1.31       7.83
## 2 ahrb           1.31       7.83
ws_subthresh %>%
  select(study, median_est) %>% 
  group_by(study) %>% 
  summarise("msws median" = median(median_est), "msws min" = min(median_est), "msws max" = max(median_est))
## # A tibble: 2 × 4
##   study `msws median` `msws min` `msws max`
##   <chr>         <dbl>      <dbl>      <dbl>
## 1 abcd           1.06      0.118       5.06
## 2 ahrb           1.06      0.118       5.06

3.2 Suprathreshold

cat("Suprathreshold mask")
## Suprathreshold mask
cat("\tICC, MSBS and MSWS median, miniumum and maximum")
##  ICC, MSBS and MSWS median, miniumum and maximum
icc_suprathresh %>%
  select(study, median_est) %>% 
  group_by(study) %>% 
  summarise("icc min" = median(median_est), "icc min" = min(median_est), "icc max" = max(median_est))
## # A tibble: 2 × 3
##   study `icc min` `icc max`
##   <chr>     <dbl>     <dbl>
## 1 abcd     -0.166     0.494
## 2 ahrb     -0.166     0.494
bs_suprathresh %>%
  select(study, median_est) %>% 
  group_by(study) %>% 
  summarise("msbs median" = median(median_est), "msbs min" = min(median_est), "msbs max" = max(median_est))
## # A tibble: 2 × 4
##   study `msbs median` `msbs min` `msbs max`
##   <chr>         <dbl>      <dbl>      <dbl>
## 1 abcd          0.766      0.068       4.88
## 2 ahrb          0.766      0.068       4.88
ws_suprathresh %>%
  select(study, median_est) %>% 
  group_by(study) %>% 
  summarise("msws median" = median(median_est), "msws min" = min(median_est), "msws max" = max(median_est))
## # A tibble: 2 × 4
##   study `msws median` `msws min` `msws max`
##   <chr>         <dbl>      <dbl>      <dbl>
## 1 abcd          0.636      0.072       3.19
## 2 ahrb          0.636      0.072       3.19

3.3 simlarity

cat("Similarity median, minimum and maximum for jaccard and spearman")
## Similarity median, minimum and maximum for jaccard and spearman
similarity_df %>%
  select(study, jaccard) %>% 
  group_by(study) %>% 
  summarise("jaccard median" = median(jaccard), "jaccard min" = min(jaccard), "jaccard max" = max(jaccard))
## # A tibble: 2 × 4
##   study `jaccard median` `jaccard min` `jaccard max`
##   <chr>            <dbl>         <dbl>         <dbl>
## 1 abcd            0.0578       0.00161         0.372
## 2 ahrb            0.0578       0.00161         0.372
similarity_df %>%
  select(study, spearman) %>% 
  group_by(study) %>% 
  summarise("spearman median" = median(spearman), "spearman min" = min(spearman), "spearman max" = max(spearman))
## # A tibble: 2 × 4
##   study `spearman median` `spearman min` `spearman max`
##   <chr>             <dbl>          <dbl>          <dbl>
## 1 abcd              0.174         -0.197          0.778
## 2 ahrb              0.174         -0.197          0.778

4 Specification Curve

Creating data in a format that is compatible with specr. Needs: estimate (i.e., ICC), std.error, conf.high, conf.low.

4.1 ICC

4.1.1 suprathreshold

# create specr plot for med_icc averages for 
# first, combine independent model vars into string to create average for each model type
icc_suprathresh$model_type <- paste(icc_suprathresh$fwhm,icc_suprathresh$motion,
                                    icc_suprathresh$con, icc_suprathresh$model,sep = "_")

# calculate the avg estimate of ICC across study, standard error and +/- 95% confidence interval. In complete version
df_summ <- icc_suprathresh %>% 
  group_by(model_type) %>% 
  summarise(estimate = mean(median_est), std.error = sd(median_est)/sqrt(length(median_est))) %>% 
  mutate(conf.low = estimate - 1.96 * std.error, conf.high = estimate + 1.96 * std.error) %>% 
  separate(col = model_type, into = c("fwhm","motion","contrast","model"), sep = "_|-", remove = FALSE)

4.1.1.1 All models

creating combined panel 1 and panel 2 for all model permutations first.

plot_a = plot_curve(df = df_summ, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b <- plot_choices(df = df_summ, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n ICC coefficient")

cowplot::plot_grid(plot_a, plot_b, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.1.1.2 subset models

Creating model that is subset to visualize reliability for the top (>75th) and bottom (< 25th) quartile

# get 75th/25th qunatiles
top_75q = as.numeric(quantile(df_summ$estimate, .75))
bot_25q = as.numeric(quantile(df_summ$estimate, .25))
df_summ_subset = df_summ %>% 
  filter(estimate < bot_25q | estimate > top_75q)

# subset plots
plot_a_sub = plot_curve(df = df_summ_subset, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b_sub <- plot_choices(df = df_summ_subset, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n ICC coefficient")

cowplot::plot_grid(plot_a_sub, plot_b_sub, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.1.2 subthreshold

icc_subthresh$model_type <- paste(icc_subthresh$fwhm,icc_subthresh$motion,
                                  icc_subthresh$con, icc_subthresh$model,sep = "_")

df_summ <- icc_subthresh %>% 
  group_by(model_type) %>% 
  summarise(estimate = mean(median_est), std.error = sd(median_est)/sqrt(length(median_est))) %>% 
  mutate(conf.low = estimate - 1.96 * std.error, conf.high = estimate + 1.96 * std.error) %>% 
  separate(col = model_type, into = c("fwhm","motion","contrast","model"), sep = "_|-", remove = FALSE)

4.1.2.1 All models

creating combined panel 1 and panel 2 for all model permutations first.

plot_a = plot_curve(df = df_summ, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b <- plot_choices(df = df_summ, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n ICC coefficient")

cowplot::plot_grid(plot_a, plot_b, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.1.2.2 subset models

Creating model that is subset to visualize reliability for the top (>75th) and bottom (< 25th) quartile

# get 75th/25th qunatiles
top_75q = as.numeric(quantile(df_summ$estimate, .75))
bot_25q = as.numeric(quantile(df_summ$estimate, .25))
df_summ_subset = df_summ %>% 
  filter(estimate < bot_25q | estimate > top_75q)

# subset plots
plot_a_sub = plot_curve(df = df_summ_subset, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b_sub <- plot_choices(df = df_summ_subset, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n ICC coefficient")

cowplot::plot_grid(plot_a_sub, plot_b_sub, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.2 MSBS

4.2.1 suprathreshold

bs_suprathresh$model_type <- paste(bs_suprathresh$fwhm,bs_suprathresh$motion,
                                   bs_suprathresh$con, bs_suprathresh$model,sep = "_")

df_summ <- bs_suprathresh %>% 
  group_by(model_type) %>% 
  summarise(estimate = mean(median_est), std.error = sd(median_est)/sqrt(length(median_est))) %>% 
  mutate(conf.low = estimate - 1.96 * std.error, conf.high = estimate + 1.96 * std.error) %>% 
  separate(col = model_type, into = c("fwhm","motion","contrast","model"), sep = "_|-", remove = FALSE)

4.2.1.1 All models

creating combined panel 1 and panel 2 for all model permutations first.

plot_a = plot_curve(df = df_summ, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b <- plot_choices(df = df_summ, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n MSBS coefficient")

cowplot::plot_grid(plot_a, plot_b, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.2.1.2 subset models

Creating model that is subset to visualize reliability for the top (>75th) and bottom (< 25th) quartile

# get 75th/25th qunatiles
top_75q = as.numeric(quantile(df_summ$estimate, .75))
bot_25q = as.numeric(quantile(df_summ$estimate, .25))
df_summ_subset = df_summ %>% 
  filter(estimate < bot_25q | estimate > top_75q)

# subset plots
plot_a_sub = plot_curve(df = df_summ_subset, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b_sub <- plot_choices(df = df_summ_subset, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n ICC coefficient")

cowplot::plot_grid(plot_a_sub, plot_b_sub, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.2.2 subthreshold

bs_subthresh$model_type <- paste(bs_subthresh$fwhm,bs_subthresh$motion,
                                 bs_subthresh$con,bs_subthresh$model,sep = "_")


df_summ <- bs_subthresh %>% 
  group_by(model_type) %>% 
  summarise(estimate = mean(median_est), std.error = sd(median_est)/sqrt(length(median_est))) %>% 
  mutate(conf.low = estimate - 1.96 * std.error, conf.high = estimate + 1.96 * std.error) %>% 
  separate(col = model_type, into = c("fwhm","motion","contrast","model"), sep = "_|-", remove = FALSE)

4.2.2.1 All models

creating combined panel 1 and panel 2 for all model permutations first.

plot_a = plot_curve(df = df_summ, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b <- plot_choices(df = df_summ, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n MSBS coefficient")

cowplot::plot_grid(plot_a, plot_b, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.2.2.2 subset models

Creating model that is subset to visualize reliability for the top (>75th) and bottom (< 25th) quartile

# get 75th/25th qunatiles
top_75q = as.numeric(quantile(df_summ$estimate, .75))
bot_25q = as.numeric(quantile(df_summ$estimate, .25))
df_summ_subset = df_summ %>% 
  filter(estimate < bot_25q | estimate > top_75q)

# subset plots
plot_a_sub = plot_curve(df = df_summ_subset, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b_sub <- plot_choices(df = df_summ_subset, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n MSBS coefficient")

cowplot::plot_grid(plot_a_sub, plot_b_sub, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.3 MSWS

4.3.1 suprathreshold

ws_suprathresh$model_type <- paste(ws_suprathresh$fwhm,ws_suprathresh$motion,
                                   bs_suprathresh$con, ws_suprathresh$model,sep = "_")

df_summ <- ws_suprathresh %>% 
  group_by(model_type) %>% 
  summarise(estimate = mean(median_est), std.error = sd(median_est)/sqrt(length(median_est))) %>% 
  mutate(conf.low = estimate - 1.96 * std.error, conf.high = estimate + 1.96 * std.error) %>% 
  separate(col = model_type, into = c("fwhm","motion","contrast","model"), sep = "_|-", remove = FALSE)

4.3.1.1 All models

creating combined panel 1 and panel 2 for all model permutations first.

plot_a = plot_curve(df = df_summ, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b <- plot_choices(df = df_summ, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n MSWS coefficient")

cowplot::plot_grid(plot_a, plot_b, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.3.1.2 subset models

Creating model that is subset to visualize reliability for the top (>75th) and bottom (< 25th) quartile

# get 75th/25th qunatiles
top_75q = as.numeric(quantile(df_summ$estimate, .75))
bot_25q = as.numeric(quantile(df_summ$estimate, .25))
df_summ_subset = df_summ %>% 
  filter(estimate < bot_25q | estimate > top_75q)

# subset plots
plot_a_sub = plot_curve(df = df_summ_subset, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b_sub <- plot_choices(df = df_summ_subset, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n MSWS coefficient")

cowplot::plot_grid(plot_a_sub, plot_b_sub, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.3.2 subthreshold

# create specr plot for med_icc averages for 
# first, combine independent model vars into string to create average for each model type
ws_subthresh$model_type <- paste(ws_subthresh$fwhm,ws_subthresh$motion,
                                 ws_subthresh$con,ws_subthresh$model,sep = "_")

# calculate the avg estimate of ICC across study, standard error and +/- 95% confidence interval. In complete version
df_summ <- ws_subthresh %>% 
  group_by(model_type) %>% 
  summarise(estimate = mean(median_est), std.error = sd(median_est)/sqrt(length(median_est))) %>% 
  mutate(conf.low = estimate - 1.96 * std.error, conf.high = estimate + 1.96 * std.error) %>% 
  separate(col = model_type, into = c("fwhm","motion","contrast","model"), sep = "_|-", remove = FALSE)

4.3.2.1 All models

creating combined panel 1 and panel 2 for all model permutations first.

plot_a = plot_curve(df = df_summ, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b <- plot_choices(df = df_summ, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n MSWS coefficient")

cowplot::plot_grid(plot_a, plot_b, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.3.2.2 subset models

Creating model that is subset to visualize reliability for the top (>75th) and bottom (< 25th) quartile

# get 75th/25th qunatiles
top_75q = as.numeric(quantile(df_summ$estimate, .75))
bot_25q = as.numeric(quantile(df_summ$estimate, .25))
df_summ_subset = df_summ %>% 
  filter(estimate < bot_25q | estimate > top_75q)

# subset plots
plot_a_sub = plot_curve(df = df_summ_subset, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b_sub <- plot_choices(df = df_summ_subset, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n MSWS coefficient")

cowplot::plot_grid(plot_a_sub, plot_b_sub, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.4 Similarity

4.4.1 Jaccard

similarity_df$model_type <- paste(similarity_df$fwhm,similarity_df$motion,
                                   similarity_df$con, similarity_df$model,sep = "_")

df_summ <- similarity_df %>% 
  group_by(model_type) %>% 
  summarise(estimate = mean(jaccard), std.error = sd(jaccard)/sqrt(length(jaccard))) %>% 
  mutate(conf.low = estimate - 1.96 * std.error, conf.high = estimate + 1.96 * std.error) %>% 
  separate(col = model_type, into = c("fwhm","motion","contrast","model"), sep = "_|-", remove = FALSE)

4.4.1.1 All models

creating combined panel 1 and panel 2 for all model permutations first.

plot_a = plot_curve(df = df_summ, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b <- plot_choices(df = df_summ, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n Jaccard coefficient")

cowplot::plot_grid(plot_a, plot_b, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.4.1.2 subset models

Creating model that is subset to visualize reliability for the top (>75th) and bottom (< 25th) quartile

# get 75th/25th qunatiles
top_75q = as.numeric(quantile(df_summ$estimate, .75))
bot_25q = as.numeric(quantile(df_summ$estimate, .25))
df_summ_subset = df_summ %>% 
  filter(estimate < bot_25q | estimate > top_75q)

# subset plots
plot_a_sub = plot_curve(df = df_summ_subset, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b_sub <- plot_choices(df = df_summ_subset, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n Jaccard coefficient")

cowplot::plot_grid(plot_a_sub, plot_b_sub, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.4.2 subthreshold

similarity_df$model_type <- paste(similarity_df$fwhm,similarity_df$motion,
                                  similarity_df$con, similarity_df$model, sep = "_")

# calculate the avg estimate of ICC across study, standard error and +/- 95% confidence interval. In complete version
df_summ <- similarity_df %>% 
  group_by(model_type) %>% 
  summarise(estimate = mean(spearman), std.error = sd(spearman)/sqrt(length(spearman))) %>% 
  mutate(conf.low = estimate - 1.96 * std.error, conf.high = estimate + 1.96 * std.error) %>% 
  separate(col = model_type, into = c("fwhm","motion","contrast","model"), sep = "_|-", remove = FALSE)

4.4.2.1 All models

creating combined panel 1 and panel 2 for all model permutations first.

plot_a = plot_curve(df = df_summ, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b <- plot_choices(df = df_summ, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n Spearman coefficient")

cowplot::plot_grid(plot_a, plot_b, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)

4.4.2.2 subset models

Creating model that is subset to visualize reliability for the top (>75th) and bottom (< 25th) quartile

# get 75th/25th qunatiles
top_75q = as.numeric(quantile(df_summ$estimate, .75))
bot_25q = as.numeric(quantile(df_summ$estimate, .25))
df_summ_subset = df_summ %>% 
  filter(estimate < bot_25q | estimate > top_75q)

# subset plots
plot_a_sub = plot_curve(df = df_summ_subset, ci = TRUE, desc = FALSE, legend = FALSE, null = 0)

plot_b_sub <- plot_choices(df = df_summ_subset, choices = c("fwhm", "motion","contrast","model"), desc = F, null = 0) +
  labs(y = "Variables", x = "Ordered Specification Curve \n MSWS coefficient")

cowplot::plot_grid(plot_a_sub, plot_b_sub, ncol = 1, align = "v", axis = 'tblr',
                   labels = c('A', 'B'), rel_heights = c(1, 2),
                   label_fontfamily = "Times", label_size = 12)